## Warning: package 'dartR' was built under R version 4.2.3
## Warning: package 'adegenet' was built under R version 4.2.2
## Warning: package 'ggplot2' was built under R version 4.2.3
## Warning: package 'dplyr' was built under R version 4.2.3
## Warning: package 'dartR.data' was built under R version 4.2.2
## Warning: package 'tidyverse' was built under R version 4.2.3
## Warning: package 'tibble' was built under R version 4.2.3
## Warning: package 'tidyr' was built under R version 4.2.3
## Warning: package 'readr' was built under R version 4.2.3
## Warning: package 'purrr' was built under R version 4.2.3
## Warning: package 'stringr' was built under R version 4.2.3
## Warning: package 'forcats' was built under R version 4.2.3
## Warning: package 'lubridate' was built under R version 4.2.3
## Warning: package 'hierfstat' was built under R version 4.2.2
## Warning: package 'gt' was built under R version 4.2.3
## Warning: package 'here' was built under R version 4.2.2
## Warning: package 'readxl' was built under R version 4.2.3
#use the corrected cohorts
new_cohort_assignment <- TRUE
#use the new fixed genomes or old or new with filitration that matches old
# "new" or "old"
use_fixed_genotypes <- "new"
#adjust these if you want the relevant chunks to run
rerun_COLONY <- FALSE
#COLONY params for simulations that will actually be used
COLONY_run_length <- 2
COLONY_allele_freq <- NULL # vs "overall" for population averages.
COLONY_dropout <- 0
COLONY_error_rate <- 0.02
COLONY_random_seed <- 1
#see scenarios section for parameter choices
rerun_COLONY_all <- FALSE #this is very slow and only really needed for the sensitivity testing stuff, wouldnt normally rerun this
rerun_LDNE <- FALSE
#p_crit choices
p_crit_list <- c(0, 0.02, 0.05)
p_crit_chosen <- 0.05
include_2014 <- TRUE #will still run 2014 estimates, just not included in the analysis
Na_for_ratios <- 750 #from Bruce et al. (2018)
This document/repository contains and outlines the re-analysis of the data presented in Davenport et al 2021 Davenport et al. (2021), as re-re-analysed by Andrew Jones.
The authors were made aware of a bug or error in the output-files used in both NeEstimator and Colony to estimate the number of breeders per cohort. This error caused the data to become shuffled. Below, analysis is presented comparing the published data to files made directly from the original raw data. The input files for Nb estimation for NeEstimator and COLONY are re-made using raw data (based on the published loci) and the updated results are presented. The published work further sought to combine estimators of effective size to make reporting and decision making easier - combined estimates of Nb per-cohort. Here using the revised results we also make these re-estimates.
In Davenport et al., 2021, the effective number of breeders (Nb) was estimated in 4 consecutive cohorts (2010-2013) based on the premise that when a genetic sample contains only individuals from a single age cohort (a group of individuals having the same age-class), then the estimate of effective population size (Ne) from a single-sample estimator in species with overlapping generations corresponds to the effective number of breeders (Nb). For long-lived, iteroparous species such as the white shark, estimates of Nb are generally considered more useful for monitoring as they apply to a single breeding season (rather than needing a sample representative of a generation - an assumption of Ne (see Waples (2022))), and it represents an accessible parameter for monitoring population trends at ecological timescales most relevant to conservation and management needs. Nb is particularly useful in cases where juvenile or YOY samples can be easily collected (i.e. through SMART shark program NSW). Estimating Nb and monitoring its change over time allows timely detection of population trends (decline, restoration, recovery, expansion), even if using as few as four or five consecutive reproductive cycles (Leberg (2005); J. Wang (2005); Luikart et al. (2021)).
The original DArT data for this project can be found in the file
/Data/Raw
The results of the reanalysis can be found in /Results.
The processed Data is found in /Data/processed.
The filtered list of loci from the published analysis can be found in Data/Raw/Report-DSha18-3402/File_Formats/Genepop_NeEstimator_Input/nswdpi_whiteshark_gp.gen.
The loci names were extracted from this document to ensure the data from the publication are used in the reanalysis here. Readers are referred to the original publication Davenport et al. (2021) for more detailed methods. In summary, a list of loci/SNPs which meet the articles filtering criteria are saved in the ‘.gen’ file. These are used here to re-make the input files for NeEstimator and COLONY from the original raw-data, from which Nb per cohort is re-estimated.The full raw data is also used to re-estimate Nb using a sensitivity analysis of loci/individuals.
A bug in an R-package used in the original publication is suspected to have introduced inconsistencies into the output files used in the final analysis.
# read in published strata
strata_info = read.table("Original Project Files/Strata_Sex_Model_COHORT_REGRESSION.tsv", header = T) # used in the published ms
# read in published genepop file affected by bug - herein refered to as 'orig-genepop'
orig_gp <- adegenet::read.genepop(file = "Original Project Files/File_Formats/Genepop_NeEstimator_Input/nswdpi_whiteshark_gp.gen", ncode = 3L, quiet = TRUE)
orig_gl <- dartR::gi2gl(orig_gp)
## Starting ::
## Starting dartR
## Starting gi2gl
## Starting gl.compliance.check
## Processing genlight object with SNP data
## The slot loc.all, which stores allele name for each locus, is empty.
## Creating a dummy variable (A/C) to insert in this slot.
## Checking coding of SNPs
## SNP data scored NA, 0, 1 or 2 confirmed
## Checking locus metrics and flags
## Recalculating locus metrics
## Checking for monomorphic loci
## Dataset contains monomorphic loci
## Checking for loci with all missing data
## No loci with all missing data detected
## Checking whether individual names are unique.
## Checking for individual metrics
## Warning: Creating a slot for individual metrics
## Checking for population assignments
## Population assignments confirmed
## Spelling of coordinates checked and changed if necessary to
## lat/lon
## Completed: gl.compliance.check
## Completed: ::
## Completed: dartR
## Completed: gi2gl
nInd(orig_gl)
## [1] 241
nLoc(orig_gl)
## [1] 3668
# it didnt fix the names, so do it here
orig_gl@loc.names<- gsub("CHROM_1-", "",stringr::str_replace_all(orig_gl@loc.names,"__","-")) # change whitelist loci seperators so they are in the fornat needed to match the genlight obj
# 'new_genepop'
# read in orgional data, and use the list of loci to make a new dataset - herein refered to as 'new-genepop'
input_gl = dartR::gl.read.dart("Data/Raw/Report_DSha18-3402_SNP_2_ReLabeled.csv")
## Starting ::
## Starting dartR
## Starting gl.read.dart
## Starting utils.read.dart
## Topskip not provided.
## Setting topskip to 6 .
## Reading in the SNP data
## Detected 2 row format.
## Number of rows per clone (should be only 2 s): 2
## Added the following locus metrics:
## AlleleID AlleleSequence TrimmedSequence Chrom_Shark_Callorhinchus_v1 ChromPos_Shark_Callorhinchus_v1 AlnCnt_Shark_Callorhinchus_v1 AlnEvalue_Shark_Callorhinchus_v1 SNP SnpPosition CallRate OneRatioRef OneRatioSnp FreqHomRef FreqHomSnp FreqHets PICRef PICSnp AvgPIC AvgCountRef AvgCountSnp RepAvg .
## Recognised: 278 individuals and 9841 SNPs in a 2 row format using Data/Raw/Report_DSha18-3402_SNP_2_ReLabeled.csv
## Completed: utils.read.dart
## Starting utils.dart2genlight
## Starting conversion....
## Format is 2 rows.
## Please note conversion of bigger data sets will take some time!
## Once finished, we recommend to save the object using save(object, file="object.rdata")
## Completed: utils.dart2genlight
## Data read in. Please check carefully the output above
## Read depth calculated and added to the locus metrics
## Minor Allele Frequency (MAF) calculated and added to the locus metrics
## Recalculating locus metrics provided by DArT (optionally specified)
## Completed: ::
## Completed: dartR
## Completed: gl.read.dart
# change the GL loci names so they are in a suitable format
input_gl@loc.names <- gsub("^(.*?-.*?)-.*", "\\1", input_gl@loc.names)
# filter the gl to have the same loci as used in 'orig-gp'
order_loci <- sapply(orig_gl@loc.names, function(x,order){which(order == x)}, order = input_gl@loc.names)
new_gl <- input_gl[,order_loci]
# dartR has a bug where it doesnt fix up other information stored in other
dim(new_gl@other$loc.metrics)
## [1] 3668 24
new_gl@other$loc.metrics <- new_gl@other$loc.metrics[order_loci,]
# match so the files have the same samples, in the same order
order_ind <- sapply(orig_gl@ind.names, function(x,order){which(order == x)}, order = stringr::str_replace_all(new_gl@ind.names, "_", "-"))
new_gl <- new_gl[order_ind,]
# check
nLoc(new_gl)
## [1] 3668
nInd(new_gl)
## [1] 241
dim(new_gl@other$loc.metrics)
## [1] 3668 24
# add the population information, also make sure its in the right order
pop = dplyr::left_join(tibble::tibble(TARGET_ID=stringr::str_replace_all(new_gl@ind.names, "_", "-")), strata_info, by = "TARGET_ID")
new_gl@pop<- factor(pop$STRATA)
# check
which(head(stringr::str_replace_all(new_gl@ind.names, "_", "-")) == head(orig_gl@ind.names))
## [1] 1 2 3 4 5 6
which(head(orig_gl@loc.names) == head(new_gl@loc.names))
## [1] 1 2 3 4 5 6
# compare the old and the new files for missingness
# print out each genlight to get info on missngness, loci, invidual
orig_gl
## /// GENLIGHT OBJECT /////////
##
## // 241 genotypes, 3,668 binary SNPs, size: 1.2 Mb
## 4506 (0.51 %) missing data
##
## // Basic content
## @gen: list of 241 SNPbin
## @ploidy: ploidy of each individual (range: 2-2)
##
## // Optional content
## @ind.names: 241 individual labels
## @loc.names: 3668 locus labels
## @loc.all: 3668 alleles
## @pop: population of each individual (group size range: 1-63)
## @other: a list containing: loc.metrics loc.metrics.flags verbose history ind.metrics
# compare the old and the new files for missingness
# print out each genlight to get info on missingness, loci, individual
new_gl
## ********************
## *** DARTR OBJECT ***
## ********************
##
## ** 241 genotypes, 3,668 SNPs , size: 5.7 Mb
##
## missing data: 4503 (=0.51 %) scored as NA
##
## ** Genetic data
## @gen: list of 241 SNPbin
## @ploidy: ploidy of each individual (range: 2-2)
##
## ** Additional data
## @ind.names: 241 individual labels
## @loc.names: 3668 locus labels
## @loc.all: 3668 allele labels
## @position: integer storing positions of the SNPs [within 69 base sequence]
## @pop: population of each individual (group size range: 1-63)
## @other: a list containing: loc.metrics, ind.metrics, loc.metrics.flags, verbose, history
## @other$ind.metrics: service, plate_location
## @other$loc.metrics: AlleleID, AlleleSequence, TrimmedSequence, Chrom_Shark_Callorhinchus_v1, ChromPos_Shark_Callorhinchus_v1, AlnCnt_Shark_Callorhinchus_v1, AlnEvalue_Shark_Callorhinchus_v1, SNP, SnpPosition, CallRate, OneRatioRef, OneRatioSnp, FreqHomRef, FreqHomSnp, FreqHets, PICRef, PICSnp, AvgPIC, AvgCountRef, AvgCountSnp, RepAvg, clone, uid, rdepth
## @other$latlon[g]: no coordinates attached
These results show the number of individuals and the number of loci does not change between the published and the new dataset. However, the number of missing data in the published dataset is 4506, while the re-analysis dataset missingingess is 4503.
# visualize the data
ogplot = adegenet::glPlot(orig_gl, posi="topleft")
newplot = adegenet::glPlot(new_gl, posi="topleft")
orig_gl_m = gl2gi(orig_gl, v = 1)
## Starting gl2gi
## Matrix converted.. Prepare genind object...
## Completed: gl2gi
orig_gl.scaled_b<- adegenet::scaleGen(orig_gl_m, NA.method= "zero")
pca_og<- dudi.pca(orig_gl.scaled_b, nf = 50, scannf = FALSE, scale = F, center = T) #nf = 50
old = factoextra::fviz_pca_ind(pca_og, axes = c(1,2))
new_gl_m = gl2gi(new_gl, v = 1)
## Starting gl2gi
## Matrix converted.. Prepare genind object...
## Completed: gl2gi
new_gl.scaled_b<- adegenet::scaleGen(new_gl_m, NA.method= "zero")
pca_new<- dudi.pca(new_gl.scaled_b, nf = 50, scannf = FALSE, scale = F, center = T) #nf = 50
new = factoextra::fviz_pca_ind(pca_new, axes = c(1,2))
par(mfrow = c(1, 2))
old
new
Main points:
To avoid issues that may have unknowingly arisen throughout the pipeline of the original study, here we use the raw data, we filter following the steps from the original manuscript (using code in filter_script_dataset a and b) which implements updated r-packages available at the time of this correction and re-make the Nb estimates. These estimates are presented in the corrected manuscript.
The new cohort assignment file “Data/Processed/New_Cohort_Assignment.tsv” is created by running the the following chunks.
The von Bertanlaffy parameters used are from are from O’Connor (2011). Further work could be done exploring the impact of parameter choices, however initial work suggests the Nb estimates are fairly robust to small numbers of individuals being allocated to different cohorts, however allocation to cohorts appears sensitive to variables in the VBGF.
meta_data <- readr::read_csv("Data/Raw/Copy of UPDTAED LAT LONGS UQ genetics PhD181018 Paul Butcher NSW DPI.csv") %>%
#select(MBB_Code, FL, TL) %>%
mutate(date_column = as.Date(`Date tagged`, format="%d/%m/%y"),
modified_year = year(date_column))
# 1. relationship between TL and FL
lm1 <- lm(meta_data$TL ~ meta_data$FL)
Tl_intercept <- lm1$coefficients[1]
Tl_slope <- lm1$coefficients[2]
#
Tl_intercept <- floor(Tl_intercept * 100) / 100
Tl_slope <- floor(Tl_slope * 100) / 100 # eq (1) manuscript , round down to two decimal places
TL <- sapply(meta_data$FL, function(x) {Tl_intercept + x * Tl_slope}) # eq (1) manuscript
# Estimate age directly using values from O'Connor 2011 and FL
#solve for age
vbgf3 <- function(L, L_infinity, K_value, t_0) {
result <- t_0 - (1 / K_value) * log(1 - (L / L_infinity))
return(result)
}
# Estimating age at length
# info:
# Best fitting parmaters for Males
Linf <- 798.94# cm TL
k <- 0.047 #
L0 <- 140 #cm
T0 <- -3.8 #years
Males <- list(L_infinity_value = Linf, K_value = k, L0 = L0, t_0_value = T0)
# Best fitting paramters for Females
Linf<- 719.02# cm TL
k<- 0.056 #
L0<- 140 #cm
T0 <- -3.8 #years
Females <- list(L_infinity_value = Linf, K_value = k, L0 = L0, t_0_value = T0)
Linf<- 746.66# cm TL
k<- 0.053#
L0<- 140 #cm
T0 <- -3.8 #years
Combined <- list(L_infinity_value = Linf, K_value = k, L0 = L0, t_0_value = T0)
# female
idx_f<- which(meta_data$Sex == "F")
idx_m<- which(meta_data$Sex == "M")
male_t = sapply(TL[idx_m], function(x) {vbgf3(x, Males[["L_infinity_value"]], Males[["K_value"]], Males[["t_0_value"]])})
female_t = sapply(TL[idx_f], function(x) {vbgf3(x, Females[["L_infinity_value"]], Females[["K_value"]], Females[["t_0_value"]])})
# Cohort is equal to year sampled minus age
male_age = trunc(meta_data$modified_year[idx_m] - male_t)
female_age = trunc(meta_data$modified_year[idx_f] - female_t) # including some samples, ie. MBB1348 depends on how you round the age or the year
output = tibble::tibble(STRATA = c(male_age, female_age), MBB_CODE = c(meta_data$MBB_Code[idx_m], meta_data$MBB_Code[idx_f]))
readr::write_tsv(output, "Data/Processed/New_Cohort_Assignment.tsv")
Below the input files for NeEstimator and COLONY are remade to make new estimates of Nb using a new file made from the raw data, re filtered following the original steps (see filter_script_manuscript.R, “new_gp”).
dartR is used write out a genepop file as input for Ne estimator, and a custom script based on the radiator package is used to write out a COLONY file. These COLONY files also contain the COLONY parameter settings.
# 1. write out new_gp as a genepop , check that the file has been written out correctly
# 1a. run this file through NeEstimator
# first its important to make sure that the cohort are correctly assigned
#some sharks no cohort - why ?no meta data?
if(new_cohort_assignment){
cohort_assignment_file <- "Data/Processed/New_Cohort_Assignment.tsv"
cohort_assignment = readr::read_tsv(cohort_assignment_file) %>% #New cohort assignment
separate(MBB_CODE, into = c("string1", "string2"), sep = " ", remove = FALSE) %>%
unite(MBB_CODE_JOIN, string1, string2, sep = "_")
}else{
cohort_assignment_file <- "Original Project Files/Strata_Sex_Model_COHORT_REGRESSION.tsv"
cohort_assignment = readr::read_tsv(cohort_assignment_file) %>% #New cohort assignment
separate(INDIVIDUALS, into = c("string1", "string2"), sep = "-", remove = FALSE) %>%
unite(MBB_CODE_JOIN, string1, string2, sep = "_")
}
if(use_fixed_genotypes == "old"){
gl_file <- orig_gl
}else if(use_fixed_genotypes == "new"){
str_File_Name_FILTERED <-'./Data/Processed/filtered_genotypes_datasetb.RData'
gl_file <- readRDS(str_File_Name_FILTERED)
}else{
message("need to choose one of old, new, or new_w_old_filt for use_fixed_genotypes")
}
gl_file$ind.names <- str_replace(gl_file$ind.names, "-", "_")
ind_order = tibble::tibble(MBB_CODE_JOIN = gl_file$ind.names, OLD_STRATA = gl_file@pop) %>%
left_join(., cohort_assignment, by = "MBB_CODE_JOIN")
gl_file@pop <- as.factor(ind_order$STRATA)
table(gl_file@pop)
##
## 2005 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016
## 1 3 5 11 29 39 52 63 22 8 2
dartR::gl2genepop(gl_file, outfile = "genotypes_for_Ne.gen", outpath = "Data/Processed/NeEstimator")
## Starting ::
## Starting dartR
## Starting gl2genepop
## Processing genlight object with SNP data
## The genepop file is saved as: Data/Processed/NeEstimator/genotypes_for_Ne.gen/
## Completed: ::
## Completed: dartR
## Completed: gl2genepop
# check the data was written out correctly, both manually and by visualization using pca
# before writing out
td = gl2gi(gl_file, v = 1)
## Starting gl2gi
## Matrix converted.. Prepare genind object...
## Completed: gl2gi
td.scaled_b<- adegenet::scaleGen(td, NA.method= "zero")
pca<- dudi.pca(td.scaled_b, nf = 50, scannf = FALSE, scale = F, center = T) #nf = 50
factoextra::fviz_pca_ind(pca, axes = c(1,2))
# after writing out
gi = read.genepop("Data/Processed/NeEstimator/genotypes_for_Ne.gen", n = 2)
##
## Converting data from a Genepop .gen file to a genind object...
##
##
## File description: Genepop output. Loci: 4253 Populations: 11
##
## ...done.
gi.scaled_b<- adegenet::scaleGen(gi, NA.method= "zero")
gipca<- dudi.pca(td.scaled_b, nf = 50, scannf = FALSE, scale = F, center = T) #nf = 50
factoextra::fviz_pca_ind(gipca, axes = c(1,2))
PCA checking data before and after it was transformed into a genpop for Nb analysis, before(top) and after(bottom)
# yes this looks good
A number of different parameters settings were used.
For error and drop out rate, the default settings, as were used originally are based on the recommendations of Jinliang Wang (2004). More recently Jinliang Wang (2018) has done further empirical work, and the parameters were also tried as well as some inbetween.
For each of the error and drop out rate options, a version was run with population allele frequencies only based on the cohort (allele.freq = NULL, default setting) and using estimates based on the entire population (allele_freq = “overall”).
The run length parameter was also experimented with.
These test results were made using data filtered using the script in filter_script.R, they are for testing purposes only. The data used in final_scenario is from filter_script_datasetb.R.
#need to read COLONY data in from files
colony_results_files <- list.files("./Results/COLONY/")
colony_results_files <- colony_results_files[str_detect(colony_results_files, "^COLONY_output_scenario_[a-zA-Z0-9]+_[0-9]{4}.txt$")]
col_list <- list()
for (i in seq_len(length(colony_results_files))){
c_r_f <- colony_results_files[i]
res <- readLines(file.path("./Results/COLONY/", c_r_f))
temp <- str_match(c_r_f, "^COLONY_output_(scenario_[a-zA-Z0-9]+)_([0-9]{4}).txt$")
Year <- as.numeric(temp[3])
Scenario <- temp[2]
Nb_SA_est <- as.numeric(na.omit(str_match(res, "^Ne\\s+=\\s+([0-9]+)$")[, 2])[1])
Nb_SA_upper <- as.numeric(na.omit(str_match(res, "^CI95\\(U\\)\\s+=\\s+([0-9]+)$")[, 2])[1])
Nb_SA_lower <- as.numeric(na.omit(str_match(res, "^CI95\\(L\\)\\s+=\\s+([0-9]+)$")[, 2])[1])
if(file.exists(file.path("./Results/COLONY", str_replace(c_r_f, ".txt", "_FS.txt")))){
#counts of full and half sibs
res_FS <- readLines(file.path("./Results/COLONY", str_replace(c_r_f, ".txt", "_FS.txt")))
FS_count_Nb_SA <- length(res_FS)-1
}else{
FS_count_Nb_SA <- NA
}
if(file.exists(file.path("./Results/COLONY", str_replace(c_r_f, ".txt", "_HS.txt")))){
res_HS <- readLines(file.path("./Results/COLONY/", str_replace(c_r_f, ".txt", "_HS.txt")))
HS_count_Nb_SA <- length(res_HS)-1
}else{
HS_count_Nb_SA <- NA
}
col_list[[i]] <- data.frame(Year, Scenario, Nb_SA_est, Nb_SA_lower, Nb_SA_upper, FS_count_Nb_SA, HS_count_Nb_SA)
}
All_COLONY_data <- bind_rows(col_list) %>% filter(Year >= 2010, Year <= 2014)
write_csv(All_COLONY_data, "./Results/COLONY/ResultsSummary.csv")
Scenario List:
ggplot(All_COLONY_data, aes(x = Year, y = Nb_SA_est, colour = Scenario, group=Scenario)) + geom_point(position =dodge) + geom_errorbar(aes(ymin = Nb_SA_lower, ymax = Nb_SA_upper), width = width, position =dodge)
All_COLONY_data %>% filter(Scenario %in% c("scenario_00", "scenario_01", "scenario_02", "scenario_03","scenario_08", "scenario_final")) %>% ggplot( aes(x = Year, y = Nb_SA_est, colour = Scenario, group=Scenario)) + geom_point(position =dodge) + geom_errorbar(aes(ymin = Nb_SA_lower, ymax = Nb_SA_upper), width = width, position =dodge)
Nb_SA_data <- All_COLONY_data %>% filter(Scenario == "scenario_final") #need to pick one(1) for example scenario_00 is the defaults with 'quick run', scenario_08 is the original settings
write_csv(Nb_SA_data, "./Results/COLONY/ResultsSummary_final.csv")
Estimates slightly lower and more consistent for some years if use population allele frequencies, otherwise basically same. The “short” runs have a degree of inconsistency between runs, but main results will use “medium”. Overall, there is no real reason to deviate from original settings.
Nb_LD_data_all <-read_csv("./Results/NeEstimator/NeResultsSummary.csv")
Nb_LD_data_all$p_crit <- factor(Nb_LD_data_all$p_crit)
Nb_LD_data_all_plot = Nb_LD_data_all
ggplot(Nb_LD_data_all_plot, aes(x = as.factor(Year), y = Nb_LD_est, colour = p_crit, group=p_crit)) + geom_point(position =dodge) + geom_errorbar(aes(ymin = Nb_LD_lower, ymax = Nb_LD_upper), width = width, position =dodge) + coord_cartesian(ylim = c(0,1000)) + theme_bw()
Nb_LD_data <- Nb_LD_data_all %>% filter(p_crit == p_crit_chosen) #need to pick one(1) 0.05 is the original settings
write_csv(Nb_LD_data, "./Results/NeEstimator/NeResultsSummary_final.csv")
The rare allele bias issue that p_crit fixes is shown here with the different choices for p_crit. Sticking with 0.05 seems like the best option.
#read in from file so always works even if not a full rerun
Nb_LD_data <- read_csv( "./Results/NeEstimator/NeResultsSummary_final.csv")
Nb_LSA_data <- read_csv( "./Results/COLONY/ResultsSummary_final.csv")
#join and save
data <- left_join(Nb_LD_data, Nb_SA_data, by="Year")
write_csv(data, "./Results/ResultsSummary.csv")
data <- read_csv( "./Results/ResultsSummary.csv")
Ne_to_r <- function(Ne, S){
r <- (-69*S^2 + sqrt(10000 * (S^4) * (Ne^2) + 4761 * (S^4) - 248400*(S^3)*Ne) + 1800*S*(Ne^2))/( 1800*(S^2)*(Ne^2))
return(r)
}
Ne_to_r_star <- function(Ne, S){
r <- Ne_to_r(Ne, S)
r <- r - 1/S
return(r)
}
data$Var_SA_lower <- 0.25 * data$Nb_SA_est^4 * ((1 / data$Nb_SA_lower) - (1 / data$Nb_SA_est))^2
data$Var_SA_upper <- 0.25 * data$Nb_SA_est^4 * ((1 / data$Nb_SA_upper) - (1 / data$Nb_SA_est))^2
data$Var_SA_mean <- ( data$Var_SA_lower + data$Var_SA_upper ) / 2
data$Var_SA_weight <- 1 / data$Var_SA_mean
data$r_LD_lower <- Ne_to_r(data$Nb_LD_lower, data$S)
data$r_LD_upper <- Ne_to_r(data$Nb_LD_upper, data$S)
data$r_LD_est <- Ne_to_r(data$Nb_LD_est, data$S)
data$rstar_LD_lower <- Ne_to_r_star(data$Nb_LD_lower, data$S)
data$rstar_LD_upper <- Ne_to_r_star(data$Nb_LD_upper, data$S)
data$Var_LD_lower <- (1/36) * data$r_star^-4 * (data$r_star - data$rstar_LD_lower)^2
data$Var_LD_upper <- (1/36) * data$r_star^-4 * (data$r_star - data$rstar_LD_upper)^2
data$Var_LD_mean <- ( data$Var_LD_lower + data$Var_LD_upper ) / 2
data$Var_LD_weight <- 1 / data$Var_LD_mean
data$weight_sum <- data$Var_LD_weight + data$Var_SA_weight
data$Var_LD_weightadj <- data$Var_LD_weight / data$weight_sum
data$Var_SA_weightadj <- data$Var_SA_weight / data$weight_sum
data$Nb_COM_est <- 1 / ((data$Var_SA_weightadj /data$Nb_SA_est) + (data$Var_LD_weightadj / data$Nb_LD_est))
data$var_COM <- 1 / ((1/data$Var_LD_mean) + (1/data$Var_SA_mean))
#Not CIs
data$Nb_COM_lower <- data$Nb_COM_est - sqrt(data$var_COM)
data$Nb_COM_upper <- data$Nb_COM_est + sqrt(data$var_COM)
data$Nb_COM_SD <- sqrt(data$var_COM)
data$Na_Nb_ratio <- data$Nb_COM_est / Na_for_ratios
data %>% write_csv("./Results/ResultsComplete.csv")
#nice table
data %>% dplyr::select(Year, starts_with("Nb_")) -> data_est_only
if(!include_2014){
data_est_only <- data_est_only %>% filter(Year != 2014)
}else{
data_est_only <- data_est_only
}
data_est_only %>% gt() %>% fmt_number(columns = c(5:10), decimals = 1)
| Year | Nb_LD_est | Nb_LD_lower | Nb_LD_upper | Nb_SA_est | Nb_SA_lower | Nb_SA_upper | Nb_COM_est | Nb_COM_lower | Nb_COM_upper | Nb_COM_SD |
|---|---|---|---|---|---|---|---|---|---|---|
| 2010 | 63.7 | 38.7 | 2359.4 | 96.0 | 58.0 | 188.0 | 81.6 | 59.2 | 104.0 | 22.41572 |
| 2011 | 212.6 | 98.8 | 477.6 | 228.0 | 137.0 | 528.0 | 220.1 | 170.0 | 270.2 | 50.09503 |
| 2012 | 202.6 | 101.3 | 239.7 | 204.0 | 139.0 | 361.0 | 203.5 | 166.7 | 240.3 | 36.77214 |
| 2013 | 181.5 | 127.9 | 358.6 | 159.0 | 114.0 | 232.0 | 161.2 | 134.4 | 188.0 | 26.77871 |
| 2014 | 92.2 | 35.4 | 246.4 | 132.0 | 75.0 | 449.0 | 100.6 | 75.1 | 126.0 | 25.40717 |
Plot of Nb estimates with 95% confidence intervals
The combined estimates are also plotted here. The error bars in this case represent +- SD, not a confidence interval.
Plot of Combined Nb estimates +- SD
I take stability to mean that there are no significant differences between the Nb estimates for any years, this corresponds to the null hypothesis that Nb_2010 = Nb_2011 = Nb_2012 = Nb_2013 = Nb_2014.
The situation is very difficult to evaluate graphically. No hard conclusions can be drawn from examining the individual CIs alone, however there is no obvious trends and the band of values that are in all confidence intervals is relatively wide.
LD estimates with 95% CIs and values which fall in all CIs marked as a grey rectangle
In order to examine this formally, we will need to construct pairwise tests. This needs to be done with \(r^{*}\) as LDNe confidence intervals do not have normal CIs. The confidence intervals for \(r^{*}\) in LDNe are approximately normal. This method of comparison is statistically consistent with manner used in the construction of the CIs [cite: Jones, Ovenden and Wang (2016)].
A slightly more accurate result could be obtained by pulling the results directly from the LDNe code, and making minor adjustments to account for the fact this is only approximately normal, however I do not believe this would make a difference in this case.
The following table summarises the pairwise comparisons of the Nb estimates in terms of Nb. The first two columns identify which years are being compared, the third and forth columns state the relevant \(r^{*}\) values.
Their difference and the estimate for the standard deviation of the estimate follow. The combined standard deviation is found by taking the square root of the sum the of the two variances. This assumes both estimates are independent. While it is likely these estimates are correlated with each other, we have no way of accurately estimating their covariance so I believe it is best to assume independence. Holm method on the basis that we are making 6 pairwise comparisons and we wish to keep our family-wise error rate below 0.05.
data$rstar_LD_lower <- Ne_to_r_star(data$Nb_LD_lower, data$S)
data$rstar_LD_upper <- Ne_to_r_star(data$Nb_LD_upper, data$S)
data$rstar_LD_est <- Ne_to_r_star(data$Nb_LD_est, data$S)
data$rstar_sd_mean <- (data$rstar_LD_lower - data$rstar_LD_upper) / (2*qnorm(0.9750))
results_frame <- data.frame("Year1" = NA, "Year2"= NA, "r1"= NA, "r2"= NA, "diff"= NA, "combined sd"= NA, "z-score"= NA, "p-value"= NA) %>% na.omit()
for(i in 1:(nrow(data)-1)){
for(j in (i+1):nrow(data)){
temp <- c(
data$Year[i],
data$Year[j],
data$rstar_LD_est[i],
data$rstar_LD_est[j],
data$rstar_LD_est[i]-data$rstar_LD_est[j],
sqrt(data$rstar_sd_mean[i]^2 + data$rstar_sd_mean[j]^2),
(data$rstar_LD_est[i]-data$rstar_LD_est[j]) / sqrt(data$rstar_sd_mean[i]^2 + data$rstar_sd_mean[j]^2),
1-pnorm(abs(data$rstar_LD_est[i]-data$rstar_LD_est[j]) / sqrt(data$rstar_sd_mean[i]^2 + data$rstar_sd_mean[j]^2))
)
results_frame[nrow(results_frame) + 1,] <- temp
}
}
results_frame$p.value.adj <- p.adjust(results_frame$p.value, "holm")
results_frame %>% gt() %>% opt_stylize() %>% fmt_number(columns = c(7:9), decimals = 3) %>% fmt_number(columns = c(3:6), n_sigfig = 3)
| Year1 | Year2 | r1 | r2 | diff | combined.sd | z.score | p.value | p.value.adj |
|---|---|---|---|---|---|---|---|---|
| 2010 | 2011 | 0.000857 | 0.000260 | 0.000597 | 0.000367 | 1.625 | 0.052 | 0.518 |
| 2010 | 2012 | 0.000857 | 0.000273 | 0.000584 | 0.000359 | 1.628 | 0.052 | 0.518 |
| 2010 | 2013 | 0.000857 | 0.000305 | 0.000552 | 0.000357 | 1.548 | 0.061 | 0.518 |
| 2010 | 2014 | 0.000857 | 0.000594 | 0.000263 | 0.000480 | 0.547 | 0.292 | 1.000 |
| 2011 | 2012 | 0.000260 | 0.000273 | −0.0000129 | 0.000138 | −0.093 | 0.463 | 1.000 |
| 2011 | 2013 | 0.000260 | 0.000305 | −0.0000445 | 0.000133 | −0.335 | 0.369 | 1.000 |
| 2011 | 2014 | 0.000260 | 0.000594 | −0.000334 | 0.000348 | −0.962 | 0.168 | 1.000 |
| 2012 | 2013 | 0.000273 | 0.000305 | −0.0000316 | 0.000107 | −0.297 | 0.383 | 1.000 |
| 2012 | 2014 | 0.000273 | 0.000594 | −0.000321 | 0.000338 | −0.950 | 0.171 | 1.000 |
| 2013 | 2014 | 0.000305 | 0.000594 | −0.000290 | 0.000336 | −0.861 | 0.195 | 1.000 |
With the updated results, the intervals for the SA method are no longer mutually disjoint. Analysis is much the same as for LD now.
The analysis proceeds in a similar manner as for \(r^{*}\).
data$Nb_SA_est_inv <- 1 / (2*data$Nb_SA_est)
data$vstar_lower <- ((1/data$Nb_SA_lower - 1/data$Nb_SA_est) / (2*qnorm(0.9750)))^2
data$vstar_upper <- ((1/data$Nb_SA_est - 1/data$Nb_SA_upper) / (2*qnorm(0.9750)))^2
data$vstar_mean <- (data$vstar_upper+data$vstar_lower)/2
results_frame <- data.frame("Year1" = NA, "Year2"= NA, "2Nb^-1 1"= NA, "2Nb^-1 2"= NA, "diff"= NA, "combined sd"= NA, "z-score"= NA, "p-value"= NA) %>% na.omit()
for(i in 1:(nrow(data)-1)){
for(j in (i+1):nrow(data)){
temp <- c(
data$Year[i],
data$Year[j],
data$Nb_SA_est_inv[i],
data$Nb_SA_est_inv[j],
data$Nb_SA_est_inv[i]-data$Nb_SA_est_inv[j],
sqrt(data$vstar_mean[i] + data$vstar_mean[j]),
(data$Nb_SA_est_inv[i]-data$Nb_SA_est_inv[j]) / sqrt(data$vstar_mean[i] + data$vstar_mean[j]),
1-pnorm(abs(data$Nb_SA_est_inv[i]-data$Nb_SA_est_inv[j]) / sqrt(data$vstar_mean[i] + data$vstar_mean[j]))
)
results_frame[nrow(results_frame) + 1,] <- temp
}
}
results_frame$p.value.adj <- p.adjust(results_frame$p.value, "holm")
names(results_frame)[3:4] <-c('(2Ne)^-1 1', '(2Ne)^-1 2')
results_frame %>% gt() %>% opt_stylize() %>% fmt_number(columns = c(6:9), decimals = 3) %>% fmt_number(columns = c(3:5), n_sigfig = 3)
| Year1 | Year2 | (2Ne)^-1 1 | (2Ne)^-1 2 | diff | combined.sd | z.score | p.value | p.value.adj |
|---|---|---|---|---|---|---|---|---|
| 2010 | 2011 | 0.00521 | 0.00219 | 0.00302 | 0.002 | 1.789 | 0.037 | 0.368 |
| 2010 | 2012 | 0.00521 | 0.00245 | 0.00276 | 0.002 | 1.684 | 0.046 | 0.415 |
| 2010 | 2013 | 0.00521 | 0.00314 | 0.00206 | 0.002 | 1.258 | 0.104 | 0.833 |
| 2010 | 2014 | 0.00521 | 0.00379 | 0.00142 | 0.002 | 0.679 | 0.248 | 1.000 |
| 2011 | 2012 | 0.00219 | 0.00245 | −0.000258 | 0.001 | −0.289 | 0.386 | 1.000 |
| 2011 | 2013 | 0.00219 | 0.00314 | −0.000952 | 0.001 | −1.060 | 0.145 | 1.000 |
| 2011 | 2014 | 0.00219 | 0.00379 | −0.00159 | 0.002 | −1.011 | 0.156 | 1.000 |
| 2012 | 2013 | 0.00245 | 0.00314 | −0.000694 | 0.001 | −0.862 | 0.194 | 1.000 |
| 2012 | 2014 | 0.00245 | 0.00379 | −0.00134 | 0.002 | −0.876 | 0.190 | 1.000 |
| 2013 | 2014 | 0.00314 | 0.00379 | −0.000643 | 0.002 | −0.421 | 0.337 | 1.000 |
I have a number of reservations about this analysis for the COLONY estimates, but I have included this analysis as I believe it is important.
These issues are:
I have also tested for (linear) trends. With only five points the power to detect a trend is very low, but I think the exercise is worthwhile.
ols <- lm(Nb_LD_est ~ Year, data=data_est_only)
lmfit <- broom::augment(ols, se_fit = TRUE, interval='confidence')
Using the method of Luikart et al 2020 (i.e. ordinary least squares regression on the Nb_LD estimates) there is no significant trend (p-value = 0.923). We can also see this graphically as the CI for the trendline (grey shaded area) includes the possibility of a flat line (i.e. slope=0, no trend).
gls3 <- nlme::gls(Nb_LD_est ~ Year, correlation=corCAR1(0.5, form = ~ 1, fixed=TRUE), method='REML', verbose=TRUE, data=data)
# Design matrix for our observations ,,
xmat <- model.matrix(~ Year, data=data)
# Regression coefficients
betahat <- coef(gls3)
glsfit <- broom.mixed::augment(gls3)
Sigmahat <- vcov(gls3)
#https://fw8051statistics4ecologists.netlify.app/gls.html
# var/cov(beta0 + beta1*X)
varcovhat<-xmat%*%Sigmahat%*%t(xmat)
SEline <- sqrt(diag(varcovhat))
glsfit$.upper <- glsfit$.fitted + qnorm(0.975) * SEline
glsfit$.lower <- glsfit$.fitted - qnorm(0.975) * SEline
Nor is there a trend when using a GLS regression that incorporates an estimate of autocorrelation (p-value = 0.882). This model only accounts for correlation. It doesn’t resolve any of the other issues such as asymetric CIs, or incorporate other known information such as the variances of each estimate.
However these tests for a trend are likely suitable here as 4 points are very unlikely to show evidence of a trend regardless of method used. As of 2024, I do not believe anyone has published on either the use of regression models incorporating temporal correlations for use in detecting trends in effective population sizes, or any trend detecting methodolgies using r^2 values directly. As such, using OLS regression on the Nb values is effectively the state of the art.
The same analysis can be repeated with the SA estimates.
ols <- lm(Nb_SA_est ~ Year, data=data_est_only)
lmfit <- broom::augment(ols, se_fit = TRUE, interval='confidence')
Using the method of Luikart et al 2020 (i.e. ordinary least squares regression on the Nb_LD estimates) there is no significant trend (p-value = 0.989).
gls3 <- nlme::gls(Nb_SA_est ~ Year, correlation=corCAR1(0.5, form = ~ 1, fixed=TRUE), method='REML', verbose=TRUE, data=data)
# Design matrix for our observations ,,
xmat <- model.matrix(~ Year, data=data)
# Regression coefficients
betahat <- coef(gls3)
glsfit <- broom.mixed::augment(gls3)
Sigmahat <- vcov(gls3)
#https://fw8051statistics4ecologists.netlify.app/gls.html
# var/cov(beta0 + beta1*X)
varcovhat<-xmat%*%Sigmahat%*%t(xmat)
SEline <- sqrt(diag(varcovhat))
glsfit$.upper <- glsfit$.fitted + qnorm(0.975) * SEline
glsfit$.lower <- glsfit$.fitted - qnorm(0.975) * SEline
Nor is there a trend when using a GLS regression that incorporates an estimate of autocorrelation (p-value = 0.847).
Following reanalysis of the data from the raw data and following all steps from the origional publication, overall we find that while the exact point estimates vary slightly, the overall conclusion of the origional paper has not changed.
Plot of Nb estimates with 95% confidence intervals
The following outputs have been specifically requested and this section provides extra details on them.
A new file ‘/Original Project Files/Results/Original_Results.xlsx’ has been created with exact values from the published manuscript to avoid all doubt about the original numbers.
comparison_variables <- c("Year", "S", "Nb_LD_est", "Nb_LD_lower", "Nb_LD_upper", "Nb_SA_est", "Nb_SA_lower", "Nb_SA_upper", "Nb_COM_est", "Nb_COM_SD", "Na_Nb_ratio", "FS_count_Nb_SA", "HS_count_Nb_SA")
original_data <- read_xlsx('./Original Project Files/Results/Original_Results.xlsx') %>% select(all_of(comparison_variables))
new_data <- read_csv("./Results/ResultsComplete.csv") %>% select(all_of(comparison_variables))
original_data$Era <- "Original"
new_data$Era <- "Reanalysis"
comparison_table <- rbind(original_data, new_data)
comparison_table %>% write_csv("./Results/Comparison_data.csv")
comparison_table %>% gt()
| Year | S | Nb_LD_est | Nb_LD_lower | Nb_LD_upper | Nb_SA_est | Nb_SA_lower | Nb_SA_upper | Nb_COM_est | Nb_COM_SD | Na_Nb_ratio | FS_count_Nb_SA | HS_count_Nb_SA | Era |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2010 | 29 | 193.2 | 91.1 | NA | 271 | 136 | 1430 | NA | NA | NA | 2 | 2 | Original |
| 2011 | 42 | 195.1 | 104.2 | 952.9 | 344 | 204 | 923 | 233.20000 | 69.50000 | 0.3100000 | 4 | 4 | Original |
| 2012 | 52 | 165.6 | 104.2 | 359.6 | 341 | 157 | 399 | 206.10000 | 45.90000 | 0.2700000 | 8 | 6 | Original |
| 2013 | 63 | 208.5 | 116.4 | 712.7 | 289 | 200 | 461 | 252.00000 | 46.70000 | 0.3400000 | 8 | 10 | Original |
| 2014 | 23 | 521.9 | 282.2 | 3112.4 | NA | NA | NA | NA | NA | NA | NA | NA | Original |
| 2010 | 29 | 63.7 | 38.7 | 2359.4 | 96 | 58 | 188 | 81.60916 | 22.41572 | 0.1088122 | 7 | 3 | Reanalysis |
| 2011 | 39 | 212.6 | 98.8 | 477.6 | 228 | 137 | 528 | 220.11503 | 50.09503 | 0.2934867 | 4 | 5 | Reanalysis |
| 2012 | 52 | 202.6 | 101.3 | 239.7 | 204 | 139 | 361 | 203.49011 | 36.77214 | 0.2713202 | 8 | 16 | Reanalysis |
| 2013 | 63 | 181.5 | 127.9 | 358.6 | 159 | 114 | 232 | 161.18807 | 26.77871 | 0.2149174 | 16 | 21 | Reanalysis |
| 2014 | 22 | 92.2 | 35.4 | 246.4 | 132 | 75 | 449 | 100.55052 | 25.40717 | 0.1340674 | 3 | 1 | Reanalysis |
See earlier parts of this report. More can be added if required.
This can be found in /Data/Processed/NeEstimator/genotypes_for_Ne.gen
List of loci used also saved to /Data/Processed/loci_names.csv
gl_file@loc.names %>% as.data.frame() %>% write_csv("./Data/Processed/loci_names.csv")
This estimate should be treated with extreme caution when being interepreted.
gl_file_temp <- gl.merge.pop(gl_file, old = levels(gl_file@pop), new = "one-big-pop")
## Starting gl.merge.pop
## Processing genlight object with SNP data
## Merging a list of populations into one
## Merging 2005 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 into one-big-pop
## Completed: gl.merge.pop
gl.LDNe(
gl_file_temp,
neest.path = "./Executables/NeEstimator",
critical = p_crit_chosen ,
singleton.rm = FALSE,
mating = "random",
plot.out = FALSE,
verbose = 0)
## Starting gl2genepop
## Processing genlight object with SNP data
## The genepop file is saved as: C:\Users\DAVENP~1\AppData\Local\Temp\1\Rtmp8qurdY/dummy.gen/
## Completed: gl2genepop
## $`one-big-pop_MBB`
## Statistic Frequency 1 Frequency 2
## Lowest Allele Frequency Used 0.050 0+
## Harmonic Mean Sample Size 232.9 232.4
## Independent Comparisons 3141147 9041795
## OverAll r^2 0.005775 0.005485
## Expected r^2 Sample 0.004162 0.004013
## Estimated Ne^ 213.1 245.2
## CI low Parametric 203.4 223.6
## CI high Parametric 205.8 225.2
## CI low JackKnife 174.8 196.4
## CI high JackKnife 243.1 259.3
This markdown file, the associated R scripts (colony_script.R, colony_script2.R, filter_script.R ), the files in /Data/Raw/ and the executables for COLONY and NeEstimator are all that’s required to reproduce this analysis in full.
For clarity this code is reproduced here in a single block
#first we need the cohorts
# Estimate age directly using values from O'Connor 2011 and FL
#solve for age
vbgf3 <- function(L, L_infinity, K_value, t_0) {
result <- t_0 - (1 / K_value) * log(1 - (L / L_infinity))
return(result)
}
# Estimating age at length
# info:
# Best fitting parmaters for Males
Linf <- 798.94# cm TL
k <- 0.047 #
L0 <- 140 #cm
T0 <- -3.8 #years
Males <- list(L_infinity_value = Linf, K_value = k, L0 = L0, t_0_value = T0)
# Best fitting paramters for Females
Linf<- 719.02# cm TL
k<- 0.056 #
L0<- 140 #cm
T0 <- -3.8 #years
Females <- list(L_infinity_value = Linf, K_value = k, L0 = L0, t_0_value = T0)
Linf<- 746.66# cm TL
k<- 0.053#
L0<- 140 #cm
T0 <- -3.8 #years
Combined <- list(L_infinity_value = Linf, K_value = k, L0 = L0, t_0_value = T0)
# female
idx_f<- which(meta_data$Sex == "F")
idx_m<- which(meta_data$Sex == "M")
male_t = sapply(TL[idx_m], function(x) {vbgf3(x, Males[["L_infinity_value"]], Males[["K_value"]], Males[["t_0_value"]])})
female_t = sapply(TL[idx_f], function(x) {vbgf3(x, Females[["L_infinity_value"]], Females[["K_value"]], Females[["t_0_value"]])})
# Cohort is equal to year sampled minus age
male_age = trunc(meta_data$modified_year[idx_m] - male_t)
female_age = trunc(meta_data$modified_year[idx_f] - female_t) # including some samples, ie. MBB1348 depends on how you round the age or the year
output = tibble::tibble(STRATA = c(male_age, female_age), MBB_CODE = c(meta_data$MBB_Code[idx_m], meta_data$MBB_Code[idx_f]))
readr::write_tsv(output, "Data/Processed/New_Cohort_Assignment.tsv")
cohort_assignment_file <- "Data/Processed/New_Cohort_Assignment.tsv"
cohort_assignment = readr::read_tsv(cohort_assignment_file) %>% #New cohort assignment
separate(MBB_CODE, into = c("string1", "string2"), sep = " ", remove = FALSE) %>%
unite(MBB_CODE_JOIN, string1, string2, sep = "_")
#filtration happens here
source("./Scripts/filter_script_datasetb.R")
#load filteed genotypes
gl_file <- readRDS('./Data/Processed/filtered_genotypes.RData')
gl_file$ind.names <- str_replace(gl_file$ind.names, "-", "_")
ind_order = tibble::tibble(MBB_CODE_JOIN = gl_file$ind.names, OLD_STRATA = gl_file@pop) %>%
left_join(., cohort_assignment, by = "MBB_CODE_JOIN")
gl_file@pop <- as.factor(ind_order$STRATA)
dartR::gl2genepop(gl_file, outfile = "genotypes_for_Ne.gen", outpath = "Data/Processed/NeEstimator")
R.version
## _
## platform x86_64-w64-mingw32
## arch x86_64
## os mingw32
## crt ucrt
## system x86_64, mingw32
## status
## major 4
## minor 2.1
## year 2022
## month 06
## day 23
## svn rev 82513
## language R
## version.string R version 4.2.1 (2022-06-23 ucrt)
## nickname Funny-Looking Kid
sessionInfo()
## R version 4.2.1 (2022-06-23 ucrt)
## Platform: x86_64-w64-mingw32/x64 (64-bit)
## Running under: Windows 10 x64 (build 19045)
##
## Matrix products: default
##
## locale:
## [1] LC_COLLATE=English_United States.utf8
## [2] LC_CTYPE=English_United States.utf8
## [3] LC_MONETARY=English_United States.utf8
## [4] LC_NUMERIC=C
## [5] LC_TIME=English_United States.utf8
##
## attached base packages:
## [1] stats graphics grDevices utils datasets methods base
##
## other attached packages:
## [1] readxl_1.4.2 here_1.0.1 nlme_3.1-157 gt_0.10.1
## [5] hierfstat_0.5-11 lubridate_1.9.2 forcats_1.0.0 stringr_1.5.1
## [9] purrr_1.0.2 readr_2.1.4 tidyr_1.3.0 tibble_3.2.1
## [13] tidyverse_2.0.0 dartR_2.9.7 dartR.data_1.0.2 dplyr_1.1.2
## [17] ggplot2_3.5.0 adegenet_2.1.9 ade4_1.7-19
##
## loaded via a namespace (and not attached):
## [1] backports_1.4.1 spam_2.9-1 StAMPP_1.6.3
## [4] plyr_1.8.7 igraph_1.3.5 sp_2.1-4
## [7] splines_4.2.1 listenv_0.9.1 gap.datasets_0.0.5
## [10] digest_0.6.29 foreach_1.5.2 htmltools_0.5.4
## [13] viridis_0.6.3 gdata_2.19.0 fansi_1.0.3
## [16] magrittr_2.0.3 cluster_2.1.3 doParallel_1.0.17
## [19] PopGenReport_3.0.7 tzdb_0.3.0 globals_0.16.3
## [22] R.utils_2.12.2 vroom_1.6.5 timechange_0.2.0
## [25] colorspace_2.0-3 mmod_1.3.3 ggrepel_0.9.2
## [28] xfun_0.39 rgdal_1.6-4 crayon_1.5.2
## [31] jsonlite_1.8.8 iterators_1.0.14 ape_5.6-2
## [34] glue_1.6.2 gtable_0.3.4 seqinr_4.2-16
## [37] car_3.1-2 maps_3.4.1 abind_1.4-5
## [40] scales_1.3.0 mvtnorm_1.1-3 GGally_2.1.2
## [43] rstatix_0.7.2 Rcpp_1.0.11 viridisLite_0.4.2
## [46] xtable_1.8-4 bit_4.0.5 dotCall64_1.0-2
## [49] dismo_1.3-9 RColorBrewer_1.1-3 genetics_1.3.8.1.3
## [52] calibrate_1.7.7 ellipsis_0.3.2 factoextra_1.0.7.999
## [55] pkgconfig_2.0.3 reshape_0.8.9 R.methodsS3_1.8.2
## [58] farver_2.1.1 sass_0.4.6 utf8_1.2.2
## [61] tidyselect_1.2.1 labeling_0.4.3 rlang_1.1.3
## [64] reshape2_1.4.4 later_1.3.0 munsell_0.5.1
## [67] cellranger_1.1.0 tools_4.2.1 cachem_1.0.6
## [70] cli_3.6.2 generics_0.1.3 broom_1.0.5
## [73] evaluate_0.23 fastmap_1.1.0 yaml_2.3.6
## [76] bit64_4.0.5 knitr_1.43 gdsfmt_1.32.0
## [79] RgoogleMaps_1.4.5.3 future_1.33.2 mime_0.12
## [82] R.oo_1.25.0 xml2_1.3.3 gap_1.5
## [85] compiler_4.2.1 rstudioapi_0.14 png_0.1-8
## [88] ggsignif_0.6.4 bslib_0.4.2 stringi_1.7.8
## [91] gdistance_1.6.2 highr_0.10 fields_14.1
## [94] lattice_0.20-45 Matrix_1.5-1 vegan_2.6-4
## [97] permute_0.9-7 vctrs_0.6.5 furrr_0.3.1
## [100] pillar_1.9.0 lifecycle_1.0.4 combinat_0.0-8
## [103] jquerylib_0.1.4 data.table_1.14.2 SNPRelate_1.30.1
## [106] raster_3.6-14 httpuv_1.6.8 patchwork_1.2.0
## [109] R6_2.5.1 promises_1.2.0.1 gridExtra_2.3
## [112] parallelly_1.37.1 codetools_0.2-18 MASS_7.3-60.0.1
## [115] gtools_3.9.4 rprojroot_2.0.4 withr_3.0.0
## [118] broom.mixed_0.2.9.5 pegas_1.1 mgcv_1.8-40
## [121] parallel_4.2.1 hms_1.1.3 terra_1.7-39
## [124] grid_4.2.1 rmarkdown_2.21 carData_3.0-5
## [127] ggpubr_0.6.0 shiny_1.7.4